<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <title>华富</title>
  <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  <link rel="stylesheet" type="text/css" href="../../css/common.css" />
  <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
  <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css"/>
  <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <style>
        html,
        body {
            background-color: transparent;
        }

        .boxB {
            width: 100%;
            height: 100vh;
            position: relative;
        }

        .mask {
            position: absolute;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
        }

        .aui-bar-nav .aui-btn .aui-iconfont {
            color: #333;
            font-size:2rem;
            line-height: 4rem;
        }

        .box {
            padding: 0 0.5rem;
            background-color: #fff;
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
        }

        .aui-bar-nav .aui-btn {
            padding: 0;
            height:4rem;
        }

        .aui-bar-nav .aui-title {
            font-size: 1.5rem;
            min-height: 4rem;
        }

        /*header,
        .aui-bar-nav {
            padding-top: 10px !important;
        }*/

        .aui-bar-nav {
            border-bottom: 1px solid #e6e6e6;
            line-height: 4rem;
        }

        .content {
            width: 90%;
            margin: 0 auto;
        }

        .content .aui-col-xs-3 {
            font-size: 1.3rem;
            text-align: center;
            padding: 1rem 0;
        }

        .content .aui-col-xs-3 img {
          width: 45%;
          margin: 0 auto 0.6rem;
        }
    </style>
</head>

<body>
    <div class="boxB">
        <div class="mask" onclick="openF()"></div>
        <div class="box">
            <div class="aui-bar aui-bar-nav">
                <div class="aui-title">分享</div>
                <a class="aui-pull-right aui-btn" onclick="openF()">
                    <span class="aui-iconfont aui-icon-close"></span>
                </a>
            </div>
            <div class="aui-content content">
                <div class="aui-row-padded">
                    <div class="aui-col-xs-3" onclick="share_wx('session')">
                        <img src="../../image/class/wx.png" alt=""> 微信好友
                    </div>
                    <div class="aui-col-xs-3" onclick="share_wx('timeline')">
                        <img src="../../image/class/pyq.png" alt=""> 朋友圈
                    </div>
                    <div class="aui-col-xs-3" onclick="share()">
                        <img src="../../image/class/qq.png" alt=""> QQ
                    </div>
                    <div class="aui-col-xs-3" onclick="share()">
                        <img src="../../image/class/wb.png" alt=""> 新浪微博
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
<script type="text/javascript" src="../../script/swiper.min.js"></script>
<script type="text/javascript" src="../../script/aui-slide.js"></script>
<script type="text/javascript" src="../../script/aui-lazyload.js"></script>
<script type="text/javascript" src="../../script/axios.min.js"></script>
<script type="text/javascript" src="../../script/axios-config.js"></script>
<script type="text/javascript">
    function openF() {
        api.closeFrame();
    }
    apiready = function() {

    }


    // 微信分享
    function share_wx(type) {
        var wx = api.require('wx');
        const data = {
           token:$api.getStorage('token'),
           goods_id:api.pageParam.goodsid
        }
        Axios.post(window.Url.goods_info,data).then(function(res){
          if(res.status==1){
            console.log(JSON.stringify(res.share_info.share_title))
             wx.shareWebpage({
                  apiKey: '',
                  scene: type,
                  title: res.goods_name,
                  description: res.goods_desc,
                  thumb: 'widget://image/my/LOGO.png',
                  contentUrl: 'http://huafu.unohacha.com/goods/shopsDetail?id='+api.pageParam.goodsid
              }, function(ret, err) {
                // console.log(JSON.stringify(res.share_info.share_title))
                  if (ret.status) {
                      // alert('分享成功');
                      api.toast({
                          msg: '分享成功',
                          duration: 2000,
                          location: 'bottom'
                      });

                  } else {
                      console.log(err.code);
                  }
              });

          }else{
            api.toast({
                msg:res,
                duration: 2000,
                location: 'bottom'
            });
          }
        }).catch((err) => {
          api.alert({ msg: JSON.stringify(err) });
        })
    }


    // 其他分享
    function share(){
      api.toast({
          msg: '功能正在接入中...',
          duration: 2000,
          location: 'middle'
      });

    }
</script>

</html>
